/*
 * Academic License - for use in teaching, academic research, and meeting
 * course requirements at degree granting institutions only.  Not for
 * government, commercial, or other organizational use.
 *
 * File: IF_Control.h
 *
 * Code generated for Simulink model 'IF_Control'.
 *
 * Model version                  : 1.49
 * Simulink Coder version         : 9.8 (R2022b) 13-May-2022
 * C/C++ source code generated on : Tue Sep 10 22:33:31 2024
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: ARM Compatible->ARM Cortex-M
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#ifndef RTW_HEADER_IF_Control_h_
#define RTW_HEADER_IF_Control_h_
#ifndef IF_Control_COMMON_INCLUDES_
#define IF_Control_COMMON_INCLUDES_
#include "rtwtypes.h"
#endif                                 /* IF_Control_COMMON_INCLUDES_ */

#include "IF_Control_types.h"
#include "rtGetInf.h"
#include "rt_nonfinite.h"

/* Macros for accessing real-time model data structure */
#ifndef rtmGetErrorStatus
#define rtmGetErrorStatus(rtm)         ((rtm)->errorStatus)
#endif

#ifndef rtmSetErrorStatus
#define rtmSetErrorStatus(rtm, val)    ((rtm)->errorStatus = (val))
#endif

/* Block signals (default storage) */
typedef struct {
  real32_T Merge2;                     /* '<S3>/Merge2' */
  real32_T Merge1;                     /* '<S3>/Merge1' */
  real32_T Merge;                      /* '<S3>/Merge' */
  real32_T Add[3];                     /* '<S4>/Add' */
} B_IF_Control_T;

/* Block states (default storage) for system '<Root>' */
typedef struct {
  real32_T Integrator_DSTATE;          /* '<S43>/Integrator' */
  real32_T Integrator_DSTATE_l;        /* '<S91>/Integrator' */
  real32_T DiscreteTimeIntegrator1_DSTATE;/* '<S122>/Discrete-Time Integrator1' */
  real32_T DiscreteTimeIntegrator_DSTATE;/* '<S122>/Discrete-Time Integrator' */
} DW_IF_Control_T;

/* Constant parameters (default storage) */
typedef struct {
  /* Computed Parameter: sine_table_values_Value
   * Referenced by: '<S11>/sine_table_values'
   */
  real32_T sine_table_values_Value[1002];
} ConstP_IF_Control_T;

/* External inputs (root inport signals with default storage) */
typedef struct {
  real32_T iq;                         /* '<Root>/Iq_Set' */
  real32_T speed;                      /* '<Root>/Target_Speed' */
  real32_T iabc[3];                    /* '<Root>/Iabc' */
} ExtU_IF_Control_T;

/* Real-time Model Data Structure */
struct tag_RTM_IF_Control_T {
  const char_T * volatile errorStatus;
};

/* Block signals (default storage) */
extern B_IF_Control_T IF_Control_B;

/* Block states (default storage) */
extern DW_IF_Control_T IF_Control_DW;

/* External inputs (root inport signals with default storage) */
extern ExtU_IF_Control_T IF_Control_U;

/* Constant parameters (default storage) */
extern const ConstP_IF_Control_T IF_Control_ConstP;

/* Model entry point functions */
extern void IF_Control_initialize(void);
extern void IF_Control_terminate(void);

/* Customized model step function */
extern void IF_Control_step(real32_T arg_Iq_Set, real32_T arg_Target_Speed,
  real32_T arg_Iabc[3], real32_T arg_Vabc_PU[3], real32_T *arg_Out1);

/* Real-time Model object */
extern RT_MODEL_IF_Control_T *const IF_Control_M;

/*-
 * These blocks were eliminated from the model due to optimizations:
 *
 * Block '<S5>/Data Type Duplicate' : Unused code path elimination
 * Block '<S8>/Data Type Duplicate' : Unused code path elimination
 * Block '<S8>/Data Type Duplicate1' : Unused code path elimination
 * Block '<S9>/Data Type Duplicate' : Unused code path elimination
 * Block '<S9>/Vc' : Unused code path elimination
 * Block '<S114>/Data Type Duplicate' : Unused code path elimination
 * Block '<S10>/Data Type Duplicate' : Unused code path elimination
 * Block '<S10>/Data Type Duplicate1' : Unused code path elimination
 * Block '<S11>/Data Type Duplicate' : Unused code path elimination
 * Block '<S11>/Data Type Propagation' : Unused code path elimination
 * Block '<S119>/Data Type Duplicate' : Unused code path elimination
 * Block '<S120>/Data Type Duplicate' : Unused code path elimination
 * Block '<S121>/Constant2' : Unused code path elimination
 * Block '<S121>/Discrete-Time Integrator' : Unused code path elimination
 * Block '<S121>/Divide' : Unused code path elimination
 * Block '<S121>/Saturation' : Unused code path elimination
 * Block '<S122>/Scope' : Unused code path elimination
 * Block '<S11>/Get_FractionVal' : Eliminate redundant data type conversion
 * Block '<S108>/Offset' : Unused code path elimination
 * Block '<S108>/Unary_Minus' : Unused code path elimination
 * Block '<S115>/Offset' : Unused code path elimination
 * Block '<S115>/Unary_Minus' : Unused code path elimination
 */

/*-
 * The generated code includes comments that allow you to trace directly
 * back to the appropriate location in the model.  The basic format
 * is <system>/block_name, where system is the system number (uniquely
 * assigned by Simulink) and block_name is the name of the block.
 *
 * Use the MATLAB hilite_system command to trace the generated code back
 * to the model.  For example,
 *
 * hilite_system('<S3>')    - opens system 3
 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
 *
 * Here is the system hierarchy for this model
 *
 * '<Root>' : 'IF_Control'
 * '<S1>'   : 'IF_Control/Current_Loop'
 * '<S2>'   : 'IF_Control/Current_Loop/Current_Loop'
 * '<S3>'   : 'IF_Control/Current_Loop/IF_Control'
 * '<S4>'   : 'IF_Control/Current_Loop/Output_PU'
 * '<S5>'   : 'IF_Control/Current_Loop/Current_Loop/Clarke Transform'
 * '<S6>'   : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller'
 * '<S7>'   : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1'
 * '<S8>'   : 'IF_Control/Current_Loop/Current_Loop/Inverse Park Transform'
 * '<S9>'   : 'IF_Control/Current_Loop/Current_Loop/PWM Reference Generator'
 * '<S10>'  : 'IF_Control/Current_Loop/Current_Loop/Park Transform'
 * '<S11>'  : 'IF_Control/Current_Loop/Current_Loop/Sine-Cosine Lookup'
 * '<S12>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Anti-windup'
 * '<S13>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/D Gain'
 * '<S14>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Filter'
 * '<S15>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Filter ICs'
 * '<S16>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/I Gain'
 * '<S17>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Ideal P Gain'
 * '<S18>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Ideal P Gain Fdbk'
 * '<S19>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Integrator'
 * '<S20>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Integrator ICs'
 * '<S21>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/N Copy'
 * '<S22>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/N Gain'
 * '<S23>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/P Copy'
 * '<S24>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Parallel P Gain'
 * '<S25>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Reset Signal'
 * '<S26>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Saturation'
 * '<S27>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Saturation Fdbk'
 * '<S28>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Sum'
 * '<S29>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Sum Fdbk'
 * '<S30>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Tracking Mode'
 * '<S31>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Tracking Mode Sum'
 * '<S32>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Tsamp - Integral'
 * '<S33>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Tsamp - Ngain'
 * '<S34>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/postSat Signal'
 * '<S35>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/preSat Signal'
 * '<S36>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Anti-windup/Passthrough'
 * '<S37>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/D Gain/Disabled'
 * '<S38>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Filter/Disabled'
 * '<S39>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Filter ICs/Disabled'
 * '<S40>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/I Gain/Internal Parameters'
 * '<S41>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Ideal P Gain/Passthrough'
 * '<S42>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Ideal P Gain Fdbk/Disabled'
 * '<S43>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Integrator/Discrete'
 * '<S44>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Integrator ICs/Internal IC'
 * '<S45>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/N Copy/Disabled wSignal Specification'
 * '<S46>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/N Gain/Disabled'
 * '<S47>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/P Copy/Disabled'
 * '<S48>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Parallel P Gain/Internal Parameters'
 * '<S49>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Reset Signal/Disabled'
 * '<S50>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Saturation/Enabled'
 * '<S51>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Saturation Fdbk/Disabled'
 * '<S52>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Sum/Sum_PI'
 * '<S53>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Sum Fdbk/Disabled'
 * '<S54>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Tracking Mode/Disabled'
 * '<S55>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Tracking Mode Sum/Passthrough'
 * '<S56>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Tsamp - Integral/Passthrough'
 * '<S57>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/Tsamp - Ngain/Passthrough'
 * '<S58>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/postSat Signal/Forward_Path'
 * '<S59>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller/preSat Signal/Forward_Path'
 * '<S60>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Anti-windup'
 * '<S61>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/D Gain'
 * '<S62>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Filter'
 * '<S63>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Filter ICs'
 * '<S64>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/I Gain'
 * '<S65>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Ideal P Gain'
 * '<S66>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Ideal P Gain Fdbk'
 * '<S67>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Integrator'
 * '<S68>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Integrator ICs'
 * '<S69>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/N Copy'
 * '<S70>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/N Gain'
 * '<S71>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/P Copy'
 * '<S72>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Parallel P Gain'
 * '<S73>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Reset Signal'
 * '<S74>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Saturation'
 * '<S75>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Saturation Fdbk'
 * '<S76>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Sum'
 * '<S77>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Sum Fdbk'
 * '<S78>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Tracking Mode'
 * '<S79>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Tracking Mode Sum'
 * '<S80>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Tsamp - Integral'
 * '<S81>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Tsamp - Ngain'
 * '<S82>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/postSat Signal'
 * '<S83>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/preSat Signal'
 * '<S84>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Anti-windup/Passthrough'
 * '<S85>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/D Gain/Disabled'
 * '<S86>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Filter/Disabled'
 * '<S87>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Filter ICs/Disabled'
 * '<S88>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/I Gain/Internal Parameters'
 * '<S89>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Ideal P Gain/Passthrough'
 * '<S90>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Ideal P Gain Fdbk/Disabled'
 * '<S91>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Integrator/Discrete'
 * '<S92>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Integrator ICs/Internal IC'
 * '<S93>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/N Copy/Disabled wSignal Specification'
 * '<S94>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/N Gain/Disabled'
 * '<S95>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/P Copy/Disabled'
 * '<S96>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Parallel P Gain/Internal Parameters'
 * '<S97>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Reset Signal/Disabled'
 * '<S98>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Saturation/Enabled'
 * '<S99>'  : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Saturation Fdbk/Disabled'
 * '<S100>' : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Sum/Sum_PI'
 * '<S101>' : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Sum Fdbk/Disabled'
 * '<S102>' : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Tracking Mode/Disabled'
 * '<S103>' : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Tracking Mode Sum/Passthrough'
 * '<S104>' : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Tsamp - Integral/Passthrough'
 * '<S105>' : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/Tsamp - Ngain/Passthrough'
 * '<S106>' : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/postSat Signal/Forward_Path'
 * '<S107>' : 'IF_Control/Current_Loop/Current_Loop/Discrete PID Controller1/preSat Signal/Forward_Path'
 * '<S108>' : 'IF_Control/Current_Loop/Current_Loop/Inverse Park Transform/Switch_Axis'
 * '<S109>' : 'IF_Control/Current_Loop/Current_Loop/PWM Reference Generator/Modulation method'
 * '<S110>' : 'IF_Control/Current_Loop/Current_Loop/PWM Reference Generator/Voltage Input'
 * '<S111>' : 'IF_Control/Current_Loop/Current_Loop/PWM Reference Generator/Modulation method/SVPWM'
 * '<S112>' : 'IF_Control/Current_Loop/Current_Loop/PWM Reference Generator/Modulation method/SVPWM/Half(Vmin+Vmax)'
 * '<S113>' : 'IF_Control/Current_Loop/Current_Loop/PWM Reference Generator/Voltage Input/Valphabeta'
 * '<S114>' : 'IF_Control/Current_Loop/Current_Loop/PWM Reference Generator/Voltage Input/Valphabeta/Inverse Clarke Transform'
 * '<S115>' : 'IF_Control/Current_Loop/Current_Loop/Park Transform/Switch_Axis'
 * '<S116>' : 'IF_Control/Current_Loop/Current_Loop/Sine-Cosine Lookup/Interpolation'
 * '<S117>' : 'IF_Control/Current_Loop/Current_Loop/Sine-Cosine Lookup/WrapUp'
 * '<S118>' : 'IF_Control/Current_Loop/Current_Loop/Sine-Cosine Lookup/WrapUp/Compare To Zero'
 * '<S119>' : 'IF_Control/Current_Loop/Current_Loop/Sine-Cosine Lookup/WrapUp/If Action Subsystem'
 * '<S120>' : 'IF_Control/Current_Loop/Current_Loop/Sine-Cosine Lookup/WrapUp/If Action Subsystem1'
 * '<S121>' : 'IF_Control/Current_Loop/IF_Control/Switch Case Action Subsystem'
 * '<S122>' : 'IF_Control/Current_Loop/IF_Control/Switch Case Action Subsystem1'
 */
#endif                                 /* RTW_HEADER_IF_Control_h_ */

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
